Optimal. Leaf size=156 \[ \frac{8 i a^3 (a+i a \tan (c+d x))^{n-3} (e \sec (c+d x))^{6-2 n}}{d (5-n) \left (n^2-7 n+12\right )}+\frac{4 i a^2 (a+i a \tan (c+d x))^{n-2} (e \sec (c+d x))^{6-2 n}}{d \left (n^2-9 n+20\right )}+\frac{i a (a+i a \tan (c+d x))^{n-1} (e \sec (c+d x))^{6-2 n}}{d (5-n)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.225592, antiderivative size = 156, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067, Rules used = {3494, 3493} \[ \frac{8 i a^3 (a+i a \tan (c+d x))^{n-3} (e \sec (c+d x))^{6-2 n}}{d (5-n) \left (n^2-7 n+12\right )}+\frac{4 i a^2 (a+i a \tan (c+d x))^{n-2} (e \sec (c+d x))^{6-2 n}}{d \left (n^2-9 n+20\right )}+\frac{i a (a+i a \tan (c+d x))^{n-1} (e \sec (c+d x))^{6-2 n}}{d (5-n)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3494
Rule 3493
Rubi steps
\begin{align*} \int (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^n \, dx &=\frac{i a (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-1+n}}{d (5-n)}+\frac{(4 a) \int (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-1+n} \, dx}{5-n}\\ &=\frac{4 i a^2 (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-2+n}}{d \left (20-9 n+n^2\right )}+\frac{i a (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-1+n}}{d (5-n)}+\frac{\left (8 a^2\right ) \int (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-2+n} \, dx}{20-9 n+n^2}\\ &=\frac{8 i a^3 (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-3+n}}{d (3-n) \left (20-9 n+n^2\right )}+\frac{4 i a^2 (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-2+n}}{d \left (20-9 n+n^2\right )}+\frac{i a (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-1+n}}{d (5-n)}\\ \end{align*}
Mathematica [A] time = 2.12678, size = 122, normalized size = 0.78 \[ -\frac{e^6 \sec ^5(c+d x) (\sin (3 (c+d x))+i \cos (3 (c+d x))) (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-2 n} \left (i \left (n^2-9 n+18\right ) \sin (2 (c+d x))+\left (n^2-9 n+22\right ) \cos (2 (c+d x))-2 (n-5)\right )}{d (n-5) (n-4) (n-3)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.758, size = 0, normalized size = 0. \begin{align*} \int \left ( e\sec \left ( dx+c \right ) \right ) ^{6-2\,n} \left ( a+ia\tan \left ( dx+c \right ) \right ) ^{n}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 12.563, size = 1434, normalized size = 9.19 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.07946, size = 419, normalized size = 2.69 \begin{align*} \frac{{\left ({\left (-i \, n^{2} + 9 i \, n - 20 i\right )} e^{\left (6 i \, d x + 6 i \, c\right )} +{\left (-i \, n^{2} + 11 i \, n - 30 i\right )} e^{\left (4 i \, d x + 4 i \, c\right )} +{\left (2 i \, n - 12 i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 2 i\right )} \left (\frac{2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n} \left (\frac{2 \, e e^{\left (i \, d x + i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{-2 \, n + 6} e^{\left (-6 i \, d x - 6 i \, c\right )}}{2 \,{\left (d n^{3} - 12 \, d n^{2} + 47 \, d n - 60 \, d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (e \sec \left (d x + c\right )\right )^{-2 \, n + 6}{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]